package ictbk.ttmk51.grapro.app.safephonebook;

public class Address {
	private String poBox;
	private String street;
	private String city;
	private String state;
	private String postalCode;
	private String country;
	private int type;

	public static final int TYPE_HOME = 1, TYPE_WORK = 2, TYPE_OTHER = 3,
			TYPE_CUSTOM = 0;

	public Address() {
	}

	public String getAddress() {
		return ((country != null && !country.equals("")) ? country + " > "
				: " > ")
				+ ((city != null && !city.equals("")) ? city + " > " : " > ")
				+ ((street != null && !street.equals("")) ? street + " > "
						: " > ")
				+ ((poBox != null && !poBox.equals("")) ? poBox + "(POBox) > "
						: " > ");
	}

	public int getType() {
		return type;
	}

	public String getTypeName() {
		switch (type) {
		case TYPE_HOME: {
			return "Home Address";
		}
		case TYPE_WORK: {
			return "Work Address";
		}
		case TYPE_OTHER: {
			return "Other Address";
		}
		case TYPE_CUSTOM: {
			return "Custom Address";
		}
		default: {
			return "Unknow";
		}
		}
	}

	public String getType(int type) {
		switch (type) {
		case TYPE_HOME: {
			return "Home Address";
		}
		case TYPE_WORK: {
			return "Work Address";
		}
		case TYPE_OTHER: {
			return "Other Address";
		}
		case TYPE_CUSTOM: {
			return "Custom Address";
		}
		}
		return "Unknow";
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getPoBox() {
		return poBox;
	}

	public void setPoBox(String poBox) {
		this.poBox = poBox;
	}

	public String getStreet() {
		return street;
	}

	public void setStreet(String street) {
		this.street = street;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getPostalCode() {
		return postalCode;
	}

	public void setPostalCode(String postalCode) {
		this.postalCode = postalCode;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public Address(String poBox, String street, String city, String state,
			String postal, String country, int type) {
		this.setPoBox(poBox);
		this.setStreet(street);
		this.setCity(city);
		this.setState(state);
		this.setPostalCode(postal);
		this.setCountry(country);
		this.setType(type);
	}

}
